import json

import requests


class ManageBoard:
    def getBoardSummarily(self):
        url = "http://192.168.1.224/triton/sephora/report/getBoardSummarily"
        header = {"Content-Type": "application/json;charset=UTF-8"}
        data = {"params":{"shopId":[14,11,6,10],"sephoraTerminalId":[3,13,14,21]}}
        r = requests.post(url, data=json.dumps(data), headers=header)
        print('总量数据', r.json())
        return r.json()

    def getAmounts(self):
        url = "http://192.168.1.224/triton/sephora/report/getAmounts"
        header = {"Content-Type": "application/json;charset=UTF-8"}
        data = {"params":{"shopId":[14,11,6,10],"sephoraTerminalId":[3,13,14,21],"startDate":"2020-09-16","endDate":"2020-09-20"}}
        r = requests.post(url, data=json.dumps(data), headers=header)
        print('销售额', r.json())
        return r.json()

    def getShowTimes(self):
        url = "http://192.168.1.224/triton/sephora/report/getShowTimes"
        header = {"Content-Type": "application/json;charset=UTF-8"}
        data ={"params":{"shopId":[14,11,6,10],"sephoraTerminalId":[3,13,14,21],"startDate":"2020-09-16","endDate":"2020-09-20"}}
        r = requests.post(url, data=json.dumps(data), headers=header)
        print('访问量', r.json())
        return r.json()

    def getPassingQuantity(self):
        url = "http://192.168.1.224/triton/sephora/report/getPassingQuantity"
        header = {"Content-Type": "application/json;charset=UTF-8"}
        data ={"params":{"shopId":[14,11,6,10],"sephoraTerminalId":[3,13,14,21],"startDate":"2020-09-16","endDate":"2020-09-20"}}
        r = requests.post(url, data=json.dumps(data), headers=header)
        print('屏前客流量', r.json())
        return r.json()

#a=ManageBoard()
#a.getAmounts()